<?php

include '../Classes/studentHandler.php';
include'../Classes/db.php';

$y=new DbConnect();
$conn=$y->getConnection();

$regno=$_GET['regno'];
$ini=addslashes($_GET['ini']);
$first=addslashes($_GET['first']);
$last=addslashes($_GET['last']);
$gen=$_GET['gender'];

$bdt1=$_GET['bdate'];
$month=substr($bdt1,3,2);
$year=substr($bdt1,6,4);
$day=substr($bdt1,0,2);
$b_dt=$year."-".$month."-".$day;//arrange date format

$nic=$_GET['nic'];
$add=addslashes($_GET['address']);
$cont=$_GET['contact'];
$email=$_GET['email'];
$j_dt=$_GET['jdt'];

$time_now=mktime(date('H')+5,date('i')+30,date('s'),date('m'),date('d'),date('Y'));

 	$year=date('Y',$time_now); 
 	$month=date('m',$time_now); 
 	$date=date('d',$time_now);
 
$st=new StudentHandler();//create a new object
		$st->setRegno($regno);
		$st->setIni($ini);
		$st->setFname($first);
		$st->setLname($last);
		$st->setGender($gen);
		$st->setBday($b_dt);
		$st->setNic($nic);
		$st->setAddress($add);
		$st->setContact($cont);
		$st->setEmail($email);
		$st->setJday($j_dt);
		$st->setConnect($conn);

 
$result=$st->studentUpdate();
echo $result;

?>